import http from '../../api/http'
import {WAIT_API,WAITING_API} from '../../api/url'
export default{
    namespaced:true,
    state:{
        wait:[],
        waiting:[]
    },
    mutations:{
        setState(state,payload){
            state.wait=payload;
        },
        setWait(state,payload){
            state.waiting=payload;
            console.log(state.waiting);
        }
    },
    actions:{
        async requestWaitList(context){
            const {data:{coming}} = await http.get(WAIT_API);
            context.commit('setState',coming)
        },
        async requestWaitingList(context){
            const {data:{coming}}= await http.get(WAITING_API);
            context.commit('setWait',coming)
        }
    }
}